import proFetch from "../../../../../../public/functions/project-fetch";

/**
 * 模板浏览  用于   合同模板 /合同处理中心
 * @param pk_conmodel
 * @returns {Promise<any>}
 * @constructor
 */
export default function BrowseTempletAction(pk_org, pk_conmodel) {
    const postData = {
        pk_org,
        pk_conmodel
    };

    return new Promise(((resolve, reject) => {
            proFetch({
                url: '/nccloud/hrcm/templet/BrowseTempletAction.do',
                body: postData,
            })
                .then((res) => {
                    if (!res.success) return;
                    resolve(res);
                    if (!res.data) return;
                    let location = window.location;
                    location.port ? window.open("uclient://start/http://" + location.hostname + ":" + location.port + res.data) : window.open("uclient://start/http://" + location.hostname + res.data)
                });
        })
    );
}